package org.yuyao.common.domain.vo;

import org.yuyao.common.constant.HttpSatausConstant;

/**
 * 统一封装返回响应对象
 */
public class YuyaoResponse {
    private Integer code;
    private String msg;
    private Object data;


    public YuyaoResponse() {
    }

    public static YuyaoResponse  error(Integer code, String msg) {
        YuyaoResponse yp=new YuyaoResponse();
        yp.code = code;
        yp.msg = msg;
        yp.data = null;
        return yp;
    }

    public static YuyaoResponse  success(String msg) {
        YuyaoResponse yp=new YuyaoResponse();
        yp.code = HttpSatausConstant.SUCCESS;
        yp.msg = msg;
        yp.data = null;
        return yp;
    }

    public static YuyaoResponse  success() {
        YuyaoResponse yp=new YuyaoResponse();
        yp.code = HttpSatausConstant.SUCCESS;
        yp.msg = "成功";
        yp.data = null;
        return yp;
    }

    public YuyaoResponse(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
